import 'dart:convert';

import 'package:safetymonitor/generated/json/base/json_field.dart';
import 'package:safetymonitor/generated/json/notice_entity.g.dart';

export 'package:safetymonitor/generated/json/notice_entity.g.dart';

@JsonSerializable()
class NoticeEntity {
  NoticeEntity({
    this.id,
    this.title,
    this.type,
    this.content,
    this.status,
    this.createTime,
  });

  factory NoticeEntity.fromJson(Map<String, dynamic> json) => $NoticeEntityFromJson(json);
  int? id = 0;
  String? title = '';
  int? type = 0;
  String? content = '';

  /// ENABLE(0, "开启"),DISABLE(1, "关闭");
  int? status = 0;
  int? createTime = 0;

  Map<String, dynamic> toJson() => $NoticeEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
